package basic.comparableAndComparator;

/**
 * @Description: TODO
 * @Author: wzj
 * @Date: 2020/4/11 9:30
 */
public class Test{

    public static void main(String[] args) {
        ComparableImpl comparableImpl=new ComparableImpl(0,"ComparableImpl");
        CompareObj compareObj=new CompareObj(1,"CompareObj");
        System.out.println(comparableImpl.compareTo(compareObj));//比较两个不同类型对象

        ComparatorImpl comparatorImpl=new ComparatorImpl();
        CompareObj compareObj2=new CompareObj(3,"CompareObj");
        System.out.println(comparatorImpl.compare(compareObj,compareObj2));//比较同类型对象
    }
}
